Skip to content

Conversation

@sudo-shashank
Copy link
Contributor

@sudo-shashank sudo-shashank commented Feb 4, 2026

Summary of changes

Changes introduced in this pull request:

  • Impl Filecoin.EthTraceFilter V2 and added test.

Reference issue to close (if applicable)

Closes #6307

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • New Features

    • Added v2 API support for the Filecoin.EthTraceFilter RPC method.
  • Tests

    • Added test coverage validating v2 EthTraceFilter behavior and parity with v1 semantics.
  • Changelog

    • Added a changelog entry documenting the new Filecoin.EthTraceFilter v2 endpoint.
  • Snapshots

    • Added a new test snapshot for the v2 EthTraceFilter case.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

Walkthrough

Adds a v2 RPC endpoint Filecoin.EthTraceFilter (EthTraceFilterV2) that mirrors v1 semantics but uses the v2 tipset/block resolver; registers the new method and adds a corresponding test case and snapshot entry.

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Added unreleased entry documenting the new API v2 method Filecoin.EthTraceFilter.
Core v2 Implementation
src/rpc/methods/eth.rs
Introduces pub enum EthTraceFilterV2, an RpcMethod<1> impl for v2 (NAME=Filecoin.EthTraceFilter, alias trace_filter), adds get_eth_block_number_from_string_v2 using tipset_by_block_number_or_hash_v2, and v2 handle flow delegating to existing trace logic with sorted results.
RPC Registration
src/rpc/mod.rs
Registers EthTraceFilterV2 in the RPC methods (eth vertical) to expose the v2 API path.
Tests & Snapshots
src/tool/subcommands/api_cmd/api_compare_tests.rs, src/tool/subcommands/api_cmd/test_snapshots.txt
Adds an identity-style test case for EthTraceFilterV2 (shifted block range) and appends the snapshot filecoin_ethtracefilter_1770191732520294.rpcsnap.json.zst.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant RPC as RpcServer / EthTraceFilterV2
    participant Resolver as TipsetResolverV2
    participant DB as Blockstore
    participant Trace as TraceFilterLogic

    Client->>RPC: Call Filecoin.EthTraceFilter (filter)
    RPC->>Resolver: resolve fromBlock/toBlock (tipset_by_block_number_or_hash_v2)
    Resolver->>DB: fetch tipset by number or hash
    DB-->>Resolver: tipset (epoch)
    Resolver-->>RPC: resolved epochs
    RPC->>Trace: invoke trace_filter with resolved epochs
    Trace-->>RPC: traces (sorted)
    RPC-->>Client: return Vec<EthBlockTrace>
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • akaladarshi
  • hanabi1224
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely describes the main change: adding V2 support for Filecoin.EthTraceFilter, which matches the primary objective in the changeset.
Linked Issues check ✅ Passed The PR implements Filecoin.EthTraceFilter for RPC v2 with proper v2 block resolution, new public enum, RPC method registration, and test coverage, satisfying the linked issue #6307 objective.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing EthTraceFilterV2: new method implementation, RPC registration, tests, snapshots, and changelog entry. No unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch shashank/EthTraceFilterV2

No actionable comments were generated in the recent review. 🎉

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Comment @coderabbitai help to get the list of available commands and usage tips.

@sudo-shashank sudo-shashank added the RPC requires calibnet RPC checks to run on CI label Feb 4, 2026
@sudo-shashank sudo-shashank marked this pull request as ready for review February 5, 2026 09:38
@sudo-shashank sudo-shashank requested a review from a team as a code owner February 5, 2026 09:38
@sudo-shashank sudo-shashank requested review from akaladarshi and hanabi1224 and removed request for a team February 5, 2026 09:38
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Line 52: Update the CHANGELOG.md entry that currently references PR `#6522` to
reference issue `#6307` instead; replace the PR link
"[`#6522`](https://github.com/ChainSafe/forest/pull/6522): Implemented
`Filecoin.EthTraceFilter` for API v2." with the issue-style entry
"[`#6307`](https://github.com/ChainSafe/forest/issues/6307): Implemented
`Filecoin.EthTraceFilter` for API v2." so the changelog points to the issue
rather than the PR.

In `@src/rpc/methods/eth.rs`:
- Around line 4144-4189: The public enum EthTraceFilterV2 lacks rustdoc; add a
concise triple-slash doc comment above pub enum EthTraceFilterV2 describing its
purpose (RPC method Filecoin.EthTraceFilter / alias "trace_filter"), expected
parameter (EthTraceFilterCriteria), return type (Vec<EthBlockTrace>), and a
brief note about behavior (returns traces for transactions matching the filter
between from_block and to_block as handled in impl RpcMethod for
EthTraceFilterV2), so readers of the type and generated docs immediately
understand what this RPC endpoint represents and how it is used.

@sudo-shashank sudo-shashank marked this pull request as draft February 6, 2026 05:42
@sudo-shashank sudo-shashank marked this pull request as ready for review February 9, 2026 12:24
Copy link
Contributor

@hanabi1224 hanabi1224 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the changelog entry to the new unreleased section

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RPC requires calibnet RPC checks to run on CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RPC v2] Filecoin.EthTraceFilter

2 participants